import { RouteConfig } from 'vue-router';

const routes: RouteConfig[] = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      { path: '', component: () => import('pages/Index.vue') },
      { path: 'list/new-house', component: () => import('pages/List/NewHouse.vue'), meta: { previous: '/' } },
      { path: 'list/second-hand-house', component: () => import('pages/List/SecondHandHouse.vue'), meta: { previous: '/' } },
      { path: 'list/renting-house', component: () => import('pages/List/RentingHouse.vue'), meta: { previous: '/' } },
      {
        path: 'statistic/new-house-average-price',
        component: () => import('pages/Statistic/NewHouseAveragePrice.vue'),
        meta: { previous: '/' }
      },
      {
        path: 'statistic/second-hand-house-average-price',
        component: () => import('pages/Statistic/SecondHandHouseAveragePrice.vue'),
        meta: { previous: '/' }
      },
      {
        path: 'statistic/share-renting-house-average-price',
        component: () => import('pages/Statistic/ShareRentingHouseAveragePrice.vue'),
        meta: { previous: '/' }
      },
      {
        path: 'statistic/whole-renting-house-average-price',
        component: () => import('pages/Statistic/WholeRentingHouseAveragePrice.vue'),
        meta: { previous: '/' }
      },
      {
        path: 'statistic/user-view',
        component: () => import('pages/Statistic/UserView.vue'),
        meta: { previous: '/' }
      },
      {
        path: 'statistic/page-view',
        component: () => import('pages/Statistic/PageView.vue'),
        meta: { previous: '/' }
      }
    ]
  },

  // Always leave this as last one,
  // but you can also remove it
  {
    path: '*',
    component: () => import('pages/Error404.vue')
  }
];

export default routes;
